import clauseApi from '@/api/modules/system/clause'
const state = {
  clauseData: []
}
const mutations = {
  SET_CLAUSE_DATA (state, val) {
    // eslint-disable-next-line no-param-reassign
    state.clauseData = val
  }
}

const actions = {
  getClauseData ({ commit }, query) {
    return new Promise((resolve, reject) => {
      clauseApi.getClauseData(query).then(res => {
        console.log(res, 'clause')
        commit('SET_CLAUSE_DATA', res.data)
        resolve(true)
      }).catch(err => {
        reject(err)
      })
    })
  },
  // 详情
  // eslint-disable-next-line no-unused-vars
  getClauseDetailData ({ commit }, query) {
    return new Promise((resolve, reject) => {
      clauseApi.getClauseDetailData(query).then(res => {
        resolve(res)
      }).catch(err => {
        reject(err)
      })
    })
  }
}
const getters = {

}
export default {
  state,
  mutations,
  actions,
  getters
}
